import moment from 'moment'
import hmNavBar from '@/components/hmNavBar.vue'
import articleItem from '@/components/articleItem.vue'
export default {
  install: function (Vue) {
    // 注册一个公共组件
    Vue.component(hmNavBar.name, hmNavBar)
    Vue.component(articleItem.name, articleItem)
    // 给vue原型添加基地址
    Vue.prototype.$baseURL = '/api'
    Vue.filter('formatTime', function (value) {
      moment.locale('zh-cn') // zh-cn
      return moment(value).fromNow()
    })
    /* Vue.filter('formatChannel', function (userChannelList, recommendList) {

      return moment(value).fromNow()
    }) */
  }
}
